<%@ Register TagPrefix="ignav" Namespace="Infragistics.WebUI.UltraWebNavigator" Assembly="Infragistics2.WebUI.UltraWebNavigator.v6.1, Version=6.1.20061.1094, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" %>
<%@ Register TagPrefix="igtbl" Namespace="Infragistics.WebUI.UltraWebGrid" Assembly="Infragistics2.WebUI.UltraWebGrid.v6.1, Version=6.1.20061.1094, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" %>

<%@ Page Language="c#" Codebehind="CustomizeQuote.aspx.cs" AutoEventWireup="false"
   Inherits="QuoteAdvantage.CustomizeQuote" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
   <title>Customize Quote</title>
   <link href="QuoteAdvantageStyles.css" type="text/css" rel="stylesheet" />

   <script type="text/javascript">
         function onFormLoad()
         {
         }
         
         function addItem(strProductId)
         {
            document.Form1.txtProductId.value = strProductId;
            __doPostBack("btnAddItem", "");
            return false;            
         }
         
         function removeItem(strProductId)
         {
            document.Form1.txtProductId.value = strProductId;
            __doPostBack("btnRemoveItem", "");
            return false;            
         }
         
         function customizeItem(strUrl)
         {
            var ctlTree = igtree_getTreeById("ctlTree");
            var selectedNode = ctlTree.getSelectedNode();
            var strTag = selectedNode.getTag();
            document.location = strUrl + "&CategoryId=" + strTag;
            return false;            
         }          
         
         function onPrintClicked()
         {
            window.open("PrintQuote.aspx?orgname=<%=strOrganizationName%>&QuoteId=<%=objQuote.QuoteId%>", "print", "height=640,width=618,status=0,toolbar=0,menubar=0,scrollbars=1");
            return false;
         }
   </script>

</head>
<body class="QuoteAdvantagePage" onload="onFormLoad()" style="margin: 0px">
   <form id="Form1" method="post" runat="server">
      <table style="width: 100%; top: 0px; height: 100%">
         <tr>
            <td style="width: 240px; height: 100%">
               <table style="height: 100%">
                  <tr style="height: 16px">
                     <td>
                        <asp:Label ID="lblProductCategories" runat="server" Width="160px" CssClass="Header">Product Categories</asp:Label>
                     </td>
                  </tr>
                  <tr>
                     <td>
                        <ignav:UltraWebTree ID="ctlTree" runat="server" Width="280px" Height="100%" ImageDirectory="/ig_common/images/"
                           BackColor="White" BorderColor="DarkGray" BorderStyle="Solid" BorderWidth="1px"
                           CollapseImage="ig_treeXPMinus.gif" DefaultImage="ig_treeXPFolderClosed.gif" Cursor="Default"
                           WebTreeTarget="HierarchicalTree" Indentation="20" ExpandImage="ig_treeXPPlus.gif"
                           DefaultSelectedImage="ig_treeXPFolderOpen.gif" Font-Names="Tahoma" Font-Size="8pt">
                           <HoverNodeStyle Font-Underline="True" ForeColor="DarkBlue"></HoverNodeStyle>
                           <SelectedNodeStyle ForeColor="White" BackColor="#316AC5">
                              <Padding Bottom="2px" Left="2px" Top="2px" Right="2px"></Padding>
                           </SelectedNodeStyle>
                           <NodePaddings Bottom="1px" Left="1px" Top="1px" Right="1px"></NodePaddings>
                           <Levels>
                              <ignav:Level Index="0"></ignav:Level>
                              <ignav:Level Index="1"></ignav:Level>
                           </Levels>
                        </ignav:UltraWebTree>
                     </td>
                  </tr>
               </table>
            </td>
            <td>
               <table style="width: 100%; height: 100%">
                  <tr>
                     <td style="width: 100%; height: 20px">
                        <table style="width: 100%">
                           <tr>
                              <td>
                                 <asp:Label ID="lblAvailableItemsInCategory" runat="server" CssClass="Header" Width="100%">Available Items in Category:</asp:Label>
                              </td>
                              <td style="width: 80px; text-align: right">
                                 <asp:ImageButton ID="btnDiscount" runat="server" ImageUrl="CustomDiscount.gif" ToolTip="Discounting">
                                 </asp:ImageButton>
                                 <asp:ImageButton ID="btnPrint" runat="server" ToolTip="Generate Proposal" ImageUrl="Print.gif">
                                 </asp:ImageButton>
                                 <asp:HyperLink ID="lnkSupport" runat="server" Target="_blank" Style="padding-left: 4px">                                
                                    <img class="ImageLink" id="imgLogo" title="QuoteAdvantage Support" height="15" alt=""
                                       src="QuoteAdvantageSmall.gif" width="14" />
                                 </asp:HyperLink>
                              </td>
                           </tr>
                        </table>
                     </td>
                  </tr>
                  <tr>
                     <td style="width: 100%; height: 192px">
                        <igtbl:UltraWebGrid ID="gridAvailableProducts2" runat="server" Width="100%" ImageDirectory="/ig_common/Images/"
                           Height="192px">
                           <DisplayLayout ColWidthDefault="" AutoGenerateColumns="False" RowHeightDefault="20px"
                              Version="4.00" ScrollBarView="Vertical" AllowColSizingDefault="Free" RowSelectorsDefault="No"
                              Name="gridAvailableProducts2" TableLayout="Fixed" CellClickActionDefault="RowSelect">
                              <AddNewBox>
                                 <Style BorderWidth="1px" BorderStyle="Solid" BackColor="LightGray">

<BorderDetails ColorTop="White" WidthLeft="1px" WidthTop="1px" ColorLeft="White">
</BorderDetails>

                                    </Style>
                              </AddNewBox>
                              <Pager>
                                 <Style BorderWidth="1px" BorderStyle="Solid" BackColor="LightGray">

<BorderDetails ColorTop="White" WidthLeft="1px" WidthTop="1px" ColorLeft="White">
</BorderDetails>

                                    </Style>
                              </Pager>
                              <HeaderStyleDefault VerticalAlign="Middle" BorderStyle="Inset" HorizontalAlign="Left"
                                 BackColor="#E0E3E8" Height="22px">
                                 <BorderDetails ColorTop="DarkGray" WidthLeft="1px" ColorBottom="DarkGray" WidthTop="1px"
                                    WidthRight="2px" WidthBottom="2px"></BorderDetails>
                              </HeaderStyleDefault>
                              <FrameStyle Width="100%" Font-Size="8.5pt" Font-Names="Tahoma" BorderColor="#466094"
                                 BorderStyle="Solid" BackColor="White" Height="192px">
                                 <BorderDetails WidthLeft="1px" WidthTop="0px" WidthRight="1px" WidthBottom="1px"></BorderDetails>
                              </FrameStyle>
                              <FooterStyleDefault BorderWidth="1px" BorderStyle="Solid" BackColor="LightGray">
                                 <BorderDetails ColorTop="White" WidthLeft="1px" WidthTop="1px" ColorLeft="White"></BorderDetails>
                              </FooterStyleDefault>
                              <EditCellStyleDefault BorderWidth="0px" BorderStyle="None">
                              </EditCellStyleDefault>
                              <RowStyleDefault BorderWidth="1px" BorderStyle="Solid" BackColor="White">
                                 <Padding Left="3px"></Padding>
                                 <BorderDetails WidthLeft="0px" ColorBottom="LightGray" WidthTop="0px" ColorRight="White">
                                 </BorderDetails>
                              </RowStyleDefault>
                           </DisplayLayout>
                           <Bands>
                              <igtbl:UltraGridBand>
                                 <Columns>
                                    <igtbl:UltraGridColumn Width="55px" Type="HyperLink">
                                       <CellStyle CustomRules="color:red;" CssClass="LinkColumn">
                                       </CellStyle>
                                       <Footer Key="">
                                       </Footer>
                                       <Header Key="">
                                       </Header>
                                    </igtbl:UltraGridColumn>
                                    <igtbl:UltraGridColumn HeaderText="Name" BaseColumnName="Name">
                                       <CellStyle TextOverflow="Ellipsis">
                                       </CellStyle>
                                       <Footer Key="">
                                          <RowLayoutColumnInfo OriginX="1"></RowLayoutColumnInfo>
                                       </Footer>
                                       <Header Key="" Caption="Name">
                                          <RowLayoutColumnInfo OriginX="1"></RowLayoutColumnInfo>
                                       </Header>
                                    </igtbl:UltraGridColumn>
                                    <igtbl:UltraGridColumn HeaderText="Product ID" Width="85px" BaseColumnName="ProductNumber">
                                       <CellStyle TextOverflow="Ellipsis">
                                       </CellStyle>
                                       <Footer Key="">
                                          <RowLayoutColumnInfo OriginX="2"></RowLayoutColumnInfo>
                                       </Footer>
                                       <Header Key="" Caption="Product ID">
                                          <RowLayoutColumnInfo OriginX="2"></RowLayoutColumnInfo>
                                       </Header>
                                    </igtbl:UltraGridColumn>
                                    <igtbl:UltraGridColumn HeaderText="Cost" Width="84px" BaseColumnName="StandardCost">
                                       <Footer Key="">
                                          <RowLayoutColumnInfo OriginX="3"></RowLayoutColumnInfo>
                                       </Footer>
                                       <Header Key="" Caption="Cost">
                                          <RowLayoutColumnInfo OriginX="3"></RowLayoutColumnInfo>
                                       </Header>
                                    </igtbl:UltraGridColumn>
                                    <igtbl:UltraGridColumn HeaderText="List Price" Width="80px" BaseColumnName="ListPrice">
                                       <CellStyle TextOverflow="Ellipsis">
                                       </CellStyle>
                                       <Footer Key="">
                                          <RowLayoutColumnInfo OriginX="4"></RowLayoutColumnInfo>
                                       </Footer>
                                       <Header Key="" Caption="List Price">
                                          <RowLayoutColumnInfo OriginX="4"></RowLayoutColumnInfo>
                                       </Header>
                                    </igtbl:UltraGridColumn>
                                    <igtbl:UltraGridColumn HeaderText="Price" Width="80px" BaseColumnName="Price">
                                       <Footer Key="">
                                          <RowLayoutColumnInfo OriginX="5"></RowLayoutColumnInfo>
                                       </Footer>
                                       <Header Key="" Caption="Price">
                                          <RowLayoutColumnInfo OriginX="5"></RowLayoutColumnInfo>
                                       </Header>
                                    </igtbl:UltraGridColumn>
                                 </Columns>
                              </igtbl:UltraGridBand>
                           </Bands>
                        </igtbl:UltraWebGrid>
                     </td>
                  </tr>
                  <tr>
                     <td style="height: 20px">
                        <asp:Label ID="lblCustomizableProducts" runat="server" CssClass="Header" Width="208px">Customizable Products on Quote</asp:Label>
                     </td>
                  </tr>
                  <tr>
                     <td style="width: 100%">
                        <igtbl:UltraWebGrid ID="gridQuoteItems2" runat="server" Width="100%" ImageDirectory="/ig_common/Images/"
                           Height="100%">
                           <DisplayLayout ColWidthDefault="" AutoGenerateColumns="False" RowHeightDefault="20px"
                              Version="4.00" BorderCollapseDefault="Separate" AllowColSizingDefault="Free" RowSelectorsDefault="No"
                              Name="gridQuoteItems2" TableLayout="Fixed" CellClickActionDefault="RowSelect">
                              <AddNewBox>
                                 <Style BorderWidth="1px" BorderStyle="Solid" BackColor="LightGray">

<BorderDetails ColorTop="White" WidthLeft="1px" WidthTop="1px" ColorLeft="White">
</BorderDetails>

                                    </Style>
                              </AddNewBox>
                              <Pager>
                                 <Style BorderWidth="1px" BorderStyle="Solid" BackColor="LightGray">

<BorderDetails ColorTop="White" WidthLeft="1px" WidthTop="1px" ColorLeft="White">
</BorderDetails>

                                    </Style>
                              </Pager>
                              <HeaderStyleDefault VerticalAlign="Middle" BorderStyle="Inset" HorizontalAlign="Left"
                                 BackColor="#E0E3E8" Height="32px">
                                 <BorderDetails ColorTop="DarkGray" WidthLeft="1px" ColorBottom="DarkGray" WidthTop="1px"
                                    WidthRight="2px" WidthBottom="2px"></BorderDetails>
                              </HeaderStyleDefault>
                              <FrameStyle Width="100%" Font-Size="8.5pt" Font-Names="Tahoma" BorderColor="#466094"
                                 BorderStyle="Solid" BackColor="White" Height="100%">
                                 <BorderDetails WidthLeft="1px" WidthTop="0px" WidthRight="1px" WidthBottom="1px"></BorderDetails>
                              </FrameStyle>
                              <FooterStyleDefault BorderWidth="1px" BorderStyle="Solid" BackColor="LightGray">
                                 <BorderDetails ColorTop="White" WidthLeft="1px" WidthTop="1px" ColorLeft="White"></BorderDetails>
                              </FooterStyleDefault>
                              <EditCellStyleDefault BorderWidth="0px" BorderStyle="None">
                              </EditCellStyleDefault>
                              <RowStyleDefault BorderWidth="1px" BorderStyle="Solid" BackColor="White">
                                 <Padding Left="3px"></Padding>
                                 <BorderDetails WidthLeft="0px" ColorBottom="LightGray" WidthTop="0px" ColorRight="White">
                                 </BorderDetails>
                              </RowStyleDefault>
                           </DisplayLayout>
                           <Bands>
                              <igtbl:UltraGridBand>
                                 <Columns>
                                    <igtbl:UltraGridColumn HeaderText="Name" ChangeLinksColor="True" BaseColumnName="Name">
                                       <CellButtonStyle CssClass="GridLink">
                                       </CellButtonStyle>
                                       <CellStyle TextOverflow="Ellipsis" CssClass="LinkColumn">
                                       </CellStyle>
                                       <Footer Key="">
                                       </Footer>
                                       <Header Key="" Caption="Name">
                                       </Header>
                                    </igtbl:UltraGridColumn>
                                    <igtbl:UltraGridColumn HeaderText="Custom 1" Hidden="True" BaseColumnName="ProductCustomField1">
                                       <CellStyle TextOverflow="Ellipsis">
                                       </CellStyle>
                                       <Footer Key="">
                                          <RowLayoutColumnInfo OriginX="1"></RowLayoutColumnInfo>
                                       </Footer>
                                       <Header Key="" Caption="Custom 1">
                                          <RowLayoutColumnInfo OriginX="1"></RowLayoutColumnInfo>
                                       </Header>
                                    </igtbl:UltraGridColumn>
                                    <igtbl:UltraGridColumn HeaderText="Base Price" Width="80px" Format="" BaseColumnName="PricePerUnit">
                                       <CellStyle HorizontalAlign="Right">
                                       </CellStyle>
                                       <Footer Key="">
                                          <RowLayoutColumnInfo OriginX="2"></RowLayoutColumnInfo>
                                       </Footer>
                                       <Header Key="" Caption="Base Price">
                                          <RowLayoutColumnInfo OriginX="2"></RowLayoutColumnInfo>
                                       </Header>
                                    </igtbl:UltraGridColumn>
                                    <igtbl:UltraGridColumn HeaderText="Qty" Width="50px" BaseColumnName="Quantity" AllowUpdate="Yes">
                                       <CellStyle HorizontalAlign="Right" BackColor="PaleTurquoise">
                                       </CellStyle>
                                       <Footer Key="">
                                          <RowLayoutColumnInfo OriginX="3"></RowLayoutColumnInfo>
                                       </Footer>
                                       <Header Key="" Caption="Qty">
                                          <RowLayoutColumnInfo OriginX="3"></RowLayoutColumnInfo>
                                       </Header>
                                    </igtbl:UltraGridColumn>
                                    <igtbl:UltraGridColumn HeaderText="Discount" Width="70px" AllowUpdate="Yes">
                                       <CellStyle HorizontalAlign="Right" BackColor="PaleTurquoise">
                                       </CellStyle>
                                       <Footer Key="">
                                          <RowLayoutColumnInfo OriginX="4"></RowLayoutColumnInfo>
                                       </Footer>
                                       <Header Key="" Caption="Discount">
                                          <RowLayoutColumnInfo OriginX="4"></RowLayoutColumnInfo>
                                       </Header>
                                    </igtbl:UltraGridColumn>
                                    <igtbl:UltraGridColumn HeaderText="Discount %" Width="75px" BaseColumnName="PercentDiscount"
                                       AllowUpdate="Yes">
                                       <CellStyle HorizontalAlign="Right" BackColor="PaleTurquoise">
                                       </CellStyle>
                                       <Footer Key="">
                                          <RowLayoutColumnInfo OriginX="5"></RowLayoutColumnInfo>
                                       </Footer>
                                       <Header Key="" Caption="Discount %">
                                          <RowLayoutColumnInfo OriginX="5"></RowLayoutColumnInfo>
                                       </Header>
                                    </igtbl:UltraGridColumn>
                                    <igtbl:UltraGridColumn HeaderText="Markup %" Width="75px" BaseColumnName="PercentMarkup"
                                       AllowUpdate="Yes">
                                       <CellStyle HorizontalAlign="Right" BackColor="PaleTurquoise">
                                       </CellStyle>
                                       <Footer Key="">
                                          <RowLayoutColumnInfo OriginX="6"></RowLayoutColumnInfo>
                                       </Footer>
                                       <Header Key="" Caption="Markup %">
                                          <RowLayoutColumnInfo OriginX="6"></RowLayoutColumnInfo>
                                       </Header>
                                    </igtbl:UltraGridColumn>
                                    <igtbl:UltraGridColumn HeaderText="Custom 2" Hidden="True" BaseColumnName="ProductCustomField2">
                                       <CellStyle TextOverflow="Ellipsis">
                                       </CellStyle>
                                       <Footer Key="">
                                          <RowLayoutColumnInfo OriginX="7"></RowLayoutColumnInfo>
                                       </Footer>
                                       <Header Key="" Caption="Custom 2">
                                          <RowLayoutColumnInfo OriginX="7"></RowLayoutColumnInfo>
                                       </Header>
                                    </igtbl:UltraGridColumn>
                                    <igtbl:UltraGridColumn HeaderText="Customized&lt;br&gt;Price" Width="80px" Format="###,###,##0.00">
                                       <CellStyle HorizontalAlign="Right">
                                       </CellStyle>
                                       <Footer Key="">
                                          <RowLayoutColumnInfo OriginX="8"></RowLayoutColumnInfo>
                                       </Footer>
                                       <Header Key="" Caption="Customized&lt;br&gt;Price">
                                          <RowLayoutColumnInfo OriginX="8"></RowLayoutColumnInfo>
                                       </Header>
                                    </igtbl:UltraGridColumn>
                                    <igtbl:UltraGridColumn Width="45px" Type="HyperLink">
                                       <CellStyle CustomRules="color:red;" CssClass="LinkColumn">
                                       </CellStyle>
                                       <Footer Key="">
                                          <RowLayoutColumnInfo OriginX="9"></RowLayoutColumnInfo>
                                       </Footer>
                                       <Header Key="">
                                          <RowLayoutColumnInfo OriginX="9"></RowLayoutColumnInfo>
                                       </Header>
                                    </igtbl:UltraGridColumn>
                                 </Columns>
                              </igtbl:UltraGridBand>
                           </Bands>
                        </igtbl:UltraWebGrid>
                     </td>
                  </tr>
               </table>
            </td>
         </tr>       
      </table>
      <asp:Button ID="btnRemoveItem" Style="left: 0px; visibility: hidden; position: absolute;
         top: 0px" runat="server" Text="Remove"></asp:Button>
      <asp:Button ID="btnAddItem" Style="left: 0px; visibility: hidden; position: absolute;
         top: 0px" runat="server" Text="Add"></asp:Button>
      <asp:TextBox ID="txtProductId" Style="left: 0px; visibility: hidden; position: absolute;
         top: 0px" runat="server" Width="120px"></asp:TextBox>
   </form>
</body>
</html>
